package test;

import java.util.Scanner;

public class coffe {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int t = scan.nextInt();
        for(int i=0;i<t;i++){
            int a = scan.nextInt();
            int goal=scan.nextInt();
            boolean flag=false;
            boolean flag1=false;
            boolean flag2=false;
            for(int j=0;j<a;j++){
               int b = scan.nextInt();
               if(b==goal){
                   flag=true;
               }else if(b<goal){
                   flag1=true;
               }else{
                   flag2=true;
               }
            }
            if(flag||flag1&&flag2){
                System.out.println("YES");
            }else {
                System.out.println("NO");
            }

        }
        scan.close();
    }
}
